﻿using System;

using agsXMPP.protocol.extensions.ping;

namespace CodeSnippets
{
    class XmppPing
    {
        internal XmppPing()
        {
            /*
             * Client pings a server
             * 
             * <iq to='capulet.lit' id='c2s1' type='get'>
             *      <ping xmlns='urn:xmpp:ping'/>
             * </iq>
             */

            PingIq piq = new PingIq(new agsXMPP.Jid("capulet.lit"));
            piq.Type = agsXMPP.protocol.client.IqType.get;
            piq.Id = "c2s1";
            Program.Print(piq);

            // Send ping with autogenerated id
            PingIq piq2 = new PingIq(new agsXMPP.Jid("capulet.lit"));
            piq2.Type = agsXMPP.protocol.client.IqType.get;
            Program.Print(piq2);           
        }
    }
}